#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>

using namespace std;

vector<vector<int>> ret;
vector<int> path;
vector<bool> check;

void dfs(vector<int>& nums, int n)
{
    vector<vector<int>> ret;
    vector<int> path;
    vector<vector<int>> subsets(vector<int>&nums) {
        dfs(nums, 0);
        return ret;
    }

    void dfs(vector<int>&nums, int pos)
    {
        ret.push_back(path);
        for (int i = pos; i < nums.size(); ++i)
        {
            path.push_back(nums[i]);
            dfs(nums, i + 1);
            path.pop_back();
        }
    }
}

vector<vector<int>> subsets(vector<int>& nums) {
    check.resize(nums.size(), false);
    dfs(nums, 0);
    return ret;
}



int main()
{
    vector<int> nums = {1 , 2, 3 , 4};
    subsets(nums);
	return 0;
}